package tests;

import java.util.List;
import java.util.ArrayList;
import junit.framework.TestCase;
import bus.UserManager;
import bus.User;

public class TestUserManager extends TestCase {

    private UserManager pm;

    public void setUp() {
        pm = new UserManager();
        User p = new User();
        p.setUsername("corey");
        p.setPassword("corey1");
        List<User> al = new ArrayList<User>();
        al.add(p);
                
        MockUserManagerDaoImpl pmdao = new MockUserManagerDaoImpl();
        pmdao.setUsers(al);
        pm.setUserManagerDao(pmdao);
        pm.getUsers();
    }

    public void testGetUsers() {
        List l = pm.getUsers();
        User p1 = (User) l.get(0);
        assertEquals("corey", p1.getUsername());
    }
}